import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";
const routes = [
    //首页
    {
        path: '/',
        name: "home",
        component: () => import("@/views/Home.vue")
    },
    //分类
    {
        path: '/category',
        name: "category",
        component: () => import("@/views/product/Category.vue")
    },
    //发现
    {
        path: '/finder',
        name: "finder",
        component: () => import("@/views/Finder.vue")
    },
    //购物车
    {
        path: '/cart',
        name: "cart",
        component: () => import("@/views/Cart.vue")
    },
    //我的
    {
        path: '/my',
        name: "my",
        component: () => import("@/views/user/My.vue")
    },
    //商品列表页面
    {
        path: '/productList',
        name: "product-list",
        component: () => import("@/views/product/ProductList.vue")
    },
    //商品详情页面
    {
        path: '/productDetail',
        name: "product-detail",
        component: () => import("@/views/product/ProductDetail.vue")
    },
    //用户注册页面
    {
        path: '/register',
        name: "user-register",
        component: () => import("@/views/user/Register.vue")
    },
    //用户登录页面
    {
        path: '/login',
        name: "user-login",
        component: () => import("@/views/user/Login.vue")
    },
    //订单结算页面
    {
        path: '/ordering',
        name: "ordering",
        component: () => import("@/views/order/Ordering.vue")
    },
    //订单支付页面
    {
        path: '/order/pay',
        name: "order-pay",
        component: () => import("@/views/order/Pay.vue")
    },
    //订单列表页面
    {
        path: '/order/list',
        name: "order-list",
        component: () => import("@/views/order/List.vue")
    },
    //添加地址
    {
        path: '/address/add',
        name: "address-add",
        component: () => import("@/views/address/Add.vue")
    },
    //修改地址
    {
        path: '/address/edit',
        name: "address-edit",
        component: () => import("@/views/address/Edit.vue")
    },
    //地址列表
    {
        path: '/address/list',
        name: "address-list",
        component: () => import("@/views/address/List.vue")
    },
    
]

const router = createRouter({
    //  history: createWebHashHistory('/'),
    history: createWebHistory(),
    routes
})

export default router
